package main

import (
	"kubem/config"
	_ "kubem/controllers/initc"
	"kubem/middleware"
	"kubem/pkg/logger"
	"kubem/routes"
)

func main() {

	// 初始化路由
	router := routes.SetupRoutes()
	router.Use(middleware.JWTAuthMiddleware())

	if err := router.Run(config.Conf.Server.PortStr()); err != nil {
		logger.Error("Error starting server:", err)
	} else {
		logger.Info("Server started and listening on port:", config.Conf.Server.Port)
	}
}
